package cn.tedu.mybatisplusdemo.controller;


import cn.tedu.mybatisplusdemo.model.TUser;
import cn.tedu.mybatisplusdemo.service.ITUserService;
import cn.tedu.mybatisplusdemo.service.impl.TUserServiceImpl;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 这是用户信息表 前端控制器
 * </p>
 *
 * @author chengSir
 * @since 2022-11-10
 */
@RestController // @Controller +  @ResponseBody
@RequestMapping("/mybatisplusdemo/tUser")
public class TUserController {

    @Autowired
    private ITUserService userService;


    @RequestMapping()
    public List<TUser> findAll(int pageNum){
        // 固定每页显示 3 条
        int pageSize = 3;

        List<TUser> users = userService.findAll(pageNum,pageSize);
        return users;
    }

}
